//有向图的拓扑排序，有向无环图
//可以判断一个无向图中是否存在环

const int N = 1e5+10;

int e[N],ne[N],idx,h[N];
int n,m;
int d[N],top[N],cnt;

void add(int a,int b)
{
	e[idx] = b;
	ne[idx] = h[a];
	h[a] = idx;
	idx++;
}

bool topsort()
{
	queue<int>q;
	for(int i = 1;i<=n;i++)
		if(d[i]==0)
			q.push(i);
	while(!q.empty())
	{
		int t = q.front();
		top[cnt] = t;
		cnt++;
		q.pop();
		for(int i = h[t];i!=-1;i = ne[i])
		{
			int j = e[i];
			d[j]--;
			if(d[j]==0) q.push(j);
		}
	}
	if(cnt==n) return true;
	else return false;
}

int main()
{
	memset(h,-1,sizeof h);
	cin>>n>>m;
	for(int i = 1;i<=m;i++)
	{
		int a,b;
		cin>>a>>b;
		add(a,b);
		d[b]++;
	}
	if(topsort())
	{
		for(int i = 0;i<=n-1;i++)
		{
			cout<<top[i]<<' ';
		}
	}
	else
	{
		cout<<"-1"<<endl;
	}
} 